INPUT "vvedite frazu ", a$
DIM b$(50)
k = 1
FOR i = 1 TO LEN(a$)
IF MID$(a$, i, 1) = " " THEN k = k + 1 ELSE b$(k) = b$(k) + MID$(a$, i, 1)
NEXT
FOR i = 1 TO k
IF LEN(b$(i)) = 5 THEN
f = 0
FOR j = 1 TO 2
IF MID$(b$(i), j, 1) <> MID$(b$(i), 6 - j, 1) THEN f = 1
NEXT
IF f = 0 THEN PRINT b$(i):t=1
END IF
NEXT
if t=0 then print "takih slov net"
Тестирование выполнено в программе QB64 ( Скачать )